from django.shortcuts import render
from django.views import generic

from main.models import Author


class AuthorDisplay(generic.View):

    def get(self, request, name_slug):
        author = Author.objects.get(slug=name_slug)
        context = {'author': author}
        return render(request, 'author/author.html', context)
